package com.atguigu.lease.common.context;

/**
 * ClassName: LoginUserContext
 * Package: com.atguigu.lease.common.context
 * Description:
 *
 * @Author 咚咚小圆帽
 * @Create 2025/2/22 16:43
 * @Version 1.0
 */
public class LoginUserContext {

    private static final ThreadLocal<LoginUser> loginUserThreadLocal = new ThreadLocal<>();

    public static void setLoginUser(LoginUser loginUser) {
        loginUserThreadLocal.set(loginUser);
    }

    public static LoginUser getLoginUser() {
        return loginUserThreadLocal.get();
    }

    public static void clear() {
        loginUserThreadLocal.remove();
    }

}
